#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;

#include"string.h"


void teststring1()
{
	bit::string s1("hello world");
	cout << s1.c_str() << endl;

	bit::string s2;
	cout << s2.c_str() << endl;

	for (size_t i = 0; i < s1.size(); i++)
	{
		cout << s1[i];
	}
	cout << endl;

	bit::string::iterator it = s1.begin();
	while (it != s1.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;

	for (auto ch : s1)
	{
		cout << ch << " ";
	}

}
void teststring2()
{
	bit::string s1("hello world");
	cout << s1.c_str() << endl;

	s1.push_back('!');
	cout << s1.c_str() << endl;

	s1.append(" okkk");
	cout << s1.c_str() << endl;

	s1 += '!';
	cout << s1.c_str() << endl;

	s1 += " okkk";
	cout << s1.c_str() << endl;


}
void teststring3()
{
	bit::string s1("hello world");
	cout << s1.c_str() << endl;

	s1.insert(5, 6, 'k');
	cout << s1.c_str() << endl;

	s1.insert(6, "gshjdg");
	cout << s1.c_str() << endl;

	s1.erase(5, 6);
	cout << s1.c_str() << endl;

	size_t pos1=s1.find('k');
	cout << pos1<< endl;

	size_t pos2 = s1.find("llo");
	cout << pos2 << endl;


}
void teststring4()
{
	bit::string s1("hello world");
	cout << s1.c_str() << endl;

	s1.resize(20,'c');
	cout << s1.c_str() << endl;

}
int main()
{
	//teststring1();
	//teststring2();
	//teststring3();
	teststring4();



	return 0;
}